<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>atanh</title>
  </head>
  <body bgcolor="#FFFFFF">
    <center>Scilab Function</center>
    <div align="right">Last update : April 1993</div>
    <p>
      <b>atanh</b> -  hyperbolic tangent inverse</p>
    <h3>
      <font color="blue">Calling Sequence</font>
    </h3>
    <dl>
      <dd>
        <tt>t=atanh(x)  </tt>
      </dd>
    </dl>
    <h3>
      <font color="blue">Parameters</font>
    </h3>
    <ul>
      <li>
        <tt>
          <b>x</b>
        </tt>: real or complex vector/matrix</li>
      <li>
        <tt>
          <b>t</b>
        </tt>: real or complex vector/matrix</li>
    </ul>
    <h3>
      <font color="blue">Description</font>
    </h3>
    <p>
    The components of vector <tt>
        <b>t</b>
      </tt> are the hyperbolic tangent inverse of the 
    corresponding entries of vector <tt>
        <b>x</b>
      </tt>.
    Definition domain is <tt>
        <b>[-1,1]</b>
      </tt> for the real function (see Remark).</p>
    <h3>
      <font color="blue">Remark</font>
    </h3>
    <dl>
      <p>
    In Scilab (as in some others numerical software) when you try to evaluate an elementary
    mathematical function outside its definition domain in the real case, then the complex 
    extension is used (with a complex result). The more famous example being the sqrt
    function (try <tt>
          <b>sqrt(-1)</b>
        </tt> !). This approach have some drawbacks when you
    evaluate the function at a singular point which may led to different results when
    the point is considered as real or complex. For the <tt>
          <b>atanh</b>
        </tt> this occurs
    for <tt>
          <b>-1</b>
        </tt> and <tt>
          <b>1</b>
        </tt> because the at these points the imaginary 
    part do not converge and so <tt>
          <b>atanh(1) = +Inf + i NaN</b>
        </tt> while 
    <tt>
          <b>atanh(1) = +Inf</b>
        </tt> for the real case (as lim x-&gt;1- of atanh(x)). So
    when you evaluate this function on the vector <tt>
          <b>[1 2]</b>
        </tt> then like <tt>
          <b>2</b>
        </tt>
    is outside the definition domain, the complex extension is used for all the vector
    and you get <tt>
          <b>atanh(1) = +Inf + i NaN</b>
        </tt> while you get <tt>
          <b>atanh(1) = +Inf</b>
        </tt>
    with <tt>
          <b>[1 0.5]</b>
        </tt> for instance.</p>
    </dl>
    <h3>
      <font color="blue">Examples</font>
    </h3>
    <pre>

// example 1
x=[0,%i,-%i]
tanh(atanh(x))

// example 2
x = [-%inf -3 -2 -1 0 1 2 3 %inf]
ieee(2)
atanh(tanh(x))

// example 3 (see Remark)
ieee(2)
atanh([1 2])
atanh([1 0.5])
 
  </pre>
    <h3>
      <font color="blue">See Also</font>
    </h3>
    <p>
      <a href="tanh.htm">
        <tt>
          <b>tanh</b>
        </tt>
      </a>,&nbsp;&nbsp;<a href="../programming/ieee.htm">
        <tt>
          <b>ieee</b>
        </tt>
      </a>,&nbsp;&nbsp;</p>
  </body>
</html>
